/*****************************************************************************
 * Please See the declaration in the bottom of this file.
 *
 *
 * Version			Date				Comment
 *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Init(0)			2007.08.20 
 *****************************************************************************/

#ifndef		__LCD16x2_H__
#define		__LCD16x2_H__


extern void WriteLcdCmd(unsigned char Cmd);
extern void WriteLcdData(unsigned char Data);
extern void LCD_Init(void);
extern void WriteLcdLX(unsigned char LineNo, unsigned char XPos, unsigned char Value);
extern void SetCursorAddr(unsigned char LineNo, unsigned char XPos);
extern void CopyL2_To_L1(void);
extern void PrintLcdStr(unsigned char *Str);
extern void PrintLcdStrLX(unsigned char LineNo, unsigned char XPos, unsigned char *Str);
extern void ClearLcdLine(unsigned char LineNo);
extern void PrintLcdSpace(unsigned char Count);
extern void PrintLcdHex(unsigned int Value);
extern void PrintLcdDec(unsigned int Value);

extern unsigned char ReadLcdData(void);
extern unsigned char ReadLcdLX(unsigned char LineNo, unsigned char XPos);



//===============================
//DEFINITIONs
//===============================
#define LCD_RS			P3_4
#define LCD_E			P3_5
#define LCD_RW			P3_6
#define LCD_PORT		P0



//===============================
//MACROs
//===============================
#define SetCursorHome()		WriteLcdCmd(0x02)	//Set the cursor/display to Line0, X0.			LCDCMD_ReturnHome	0x02
#define TurnLcdOff()		WriteLcdCmd(0x08) 	//Turn off the LCD display				LCDCMD_DisOff		0x08
#define TurnLcdOn()		WriteLcdCmd(0x0C)	//Turn on the LCD display, No cursor, No blinking	LCDCMD_DisOn		0x0C
#define ClrLcdAll()		WriteLcdCmd(0x01)	//Clear all LCD display					LCDCMD_DisClear		0x01
#define CursorBack()		WriteLcdCmd(0x10)       //Move the cursor left back without changing content	LCDCMD_CursorBack	0x10



#endif









/*****************************************************************************
 * Processor:	SM59R16A2
 * Compiler:	Keil C 2.0
 *
 * Company:	SyncMOS Technologies International,Inc.
 * Author:	Stanley Huang
 *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Board:	64-pin demo board (SDB0001A-0)
 * Purpose:
 *
 *
 *****************************************************************************/


